import base from "./base"; // 导入接口域名列表
import axios from "../http"; // 导入http中创建的axios实例
import qs from "qs"; // 根据需求是否导入qs模块

const getWechat = {
  getMaterialList(params) {
    return axios.post(
      `${base.bd}/admin/wx_material/lists`,
      qs.stringify(params)
    );
  },
  deleteMaterialItems(params) {
    return axios.post(`${base.bd}/admin/wx_material/del`, qs.stringify(params));
  },
  deleteMaterialAll(params) {
    return axios.post(
      `${base.bd}/admin/wx_material/del_all`,
      qs.stringify(params)
    );
  },
  addMaterialItems(params) {
    return axios.post(
      `${base.bd}/admin/wx_material/saveadd`,
      qs.stringify(params)
    );
  },
  updateMaterialItems(params) {
    return axios.post(
      `${base.bd}/admin/wx_material/saveedit`,
      qs.stringify(params)
    );
  },
  selectMaterialItems(params) {
    return axios.post(
      `${base.bd}/admin/wx_material/find`,
      qs.stringify(params)
    );
  },
  //消息栏目
  getTemplateList(params) {
    return axios.post(
      `${base.bd}/admin/wx_sms_templet/lists`,
      qs.stringify(params)
    );
  },
  deleteTemplateItem(params) {
    return axios.post(
      `${base.bd}/admin/wx_sms_templet/del`,
      qs.stringify(params)
    );
  },
  addTemplateItem(params) {
    return axios.post(
      `${base.bd}/admin/wx_sms_templet/saveadd`,
      qs.stringify(params)
    );
  },
  updateTemplateItem(params) {
    return axios.post(
      `${base.bd}/admin/wx_sms_templet/saveedit`,
      qs.stringify(params)
    );
  },
  sortTemplate(params) {
    return axios.post(
      `${base.bd}/admin/wx_sms_templet/sort`,
      qs.stringify(params)
    );
  },
  getSmsList(params) {
    return axios.post(`${base.bd}/admin/wx_sms/lists`, qs.stringify(params));
  },
  addSmsItem(params) {
    return axios.post(`${base.bd}/admin/wx_sms/saveadd`, qs.stringify(params));
  },
  deleteSmsItem(params) {
    return axios.post(`${base.bd}/admin/wx_sms/del`, qs.stringify(params));
  },
  updateSmsItem(params) {
    return axios.post(`${base.bd}/admin/wx_sms/saveedit`, qs.stringify(params));
  },
  updateSmsItemTitle(params) {
    return axios.post(
      `${base.bd}/admin/wx_sms/saveedit_title`,
      qs.stringify(params)
    );
  },
  sortSmsItem(params) {
    return axios.post(`${base.bd}/admin/wx_sms/sort`, qs.stringify(params));
  }, //自动回复
  getWxText(params) {
    return axios.post(`${base.bd}/admin/wx_text/lists`, qs.stringify(params));
  },
  addWxText(params) {
    return axios.post(`${base.bd}/admin/wx_text/saveadd`, qs.stringify(params));
  },
  deleteWxtext(params) {
    return axios.post(`${base.bd}/admin/wx_text/del`, qs.stringify(params));
  },
  deleteAllWxtext(params) {
    return axios.post(`${base.bd}/admin/wx_text/del_all`, qs.stringify(params));
  },
  updateWxText(params) {
    return axios.post(
      `${base.bd}/admin/wx_text/saveedit`,
      qs.stringify(params)
    );
  },
  //自定义菜单
  getWxMenuList(params) {
    return axios.post(
      `${base.bd}/admin/wx_menu/list_tree`,
      qs.stringify(params)
    );
  },
  addWxMenu(params) {
    return axios.post(`${base.bd}/admin/wx_menu/saveadd`, qs.stringify(params));
  },
  updateWxMenu(params) {
    return axios.post(
      `${base.bd}/admin/wx_menu/saveedit`,
      qs.stringify(params)
    );
  },
  deleteWxMenu(params) {
    return axios.post(`${base.bd}/admin/wx_menu/del`, qs.stringify(params));
  },
  sortWxMenu(params) {
    return axios.post(
      `${base.bd}/admin/wx_menu/menu_sort`,
      qs.stringify(params)
    );
  },
  fabuMenu(params) {
    return axios.post(
      `${base.bd}/admin/wx_menu/fabu_menu`,
      qs.stringify(params)
    );
  },

  //消息
  getWxSms(params) {
    return axios.post(
      `${base.bd}/admin/wx_sms/lists_tid`,
      qs.stringify(params)
    );
  },
  uadateWxSms(params) {
    return axios.post(`${base.bd}/admin/wx_sms/saveedit`, qs.stringify(params));
  }, //首次关注
  getFirstFollow(params) {
    return axios.post(`${base.bd}/admin/wx_follow/edit`, qs.stringify(params));
  },
  setFirstFollow(params) {
    return axios.post(
      `${base.bd}/admin/wx_follow/saveedit`,
      qs.stringify(params)
    );
  }
};

export default getWechat;
